home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / strings / regexp < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.3 KB  |  39 lines

  1.           regexp ?-indices? ?-nocase? exp string ?matchVar? ?subMatchVar...?
  2.                Determines whether the regular expression  exp  matches
  3.                part or all of string and returns 1 if it does, 0 if it
  4.                doesn't.  See REGULAR EXPRESSIONS  above  for  complete
  5.                information  on the syntax of exp and how it is matched
  6.                against string.
  7.                If the -nocase  switch  is  specified  then  upper-case
  8.                characters  in  string are treated as lower case during
  9.                the matching  process.   The  -nocase  switch  must  be
  10.                specified before exp and may not be abbreviated.
  11.  
  12.                If additional arguments are specified after string then
  13.                they  are  treated  as the names of variables to use to
  14.                return  information  about  which  part(s)  of   string
  15.                matched  exp.   MatchVar  will  be  set to the range of
  16.                string that matched all of exp.  The first  subMatchVar
  17.                will  contain the characters in string that matched the
  18.                leftmost parenthesized subexpression  within  exp,  the
  19.                next  subMatchVar  will  contain  the  characters  that
  20.                matched the next  parenthesized  subexpression  to  the
  21.                right in exp, and so on.
  22.  
  23.                Normally, matchVar and the subMatchVars are set to hold
  24.                the  matching  characters from string.  However, if the
  25.                -indices switch is specified then  each  variable  will
  26.                contain  a  list  of  two  decimal  strings  giving the
  27.                indices in string of the first and last  characters  in
  28.                the  matching range of characters.  The -indices switch
  29.                must be specified before the exp argument and  may  not
  30.                be abbreviated.
  31.  
  32.                If there are more more subMatchVar's than parenthesized
  33.                subexpressions   within   exp,   or   if  a  particular
  34.                subexpression in exp doesn't  match  the  string  (e.g.
  35.                because  it  was  in  a  portion of the expression that
  36.                wasn't matched),  then  the  corresponding  subMatchVar
  37.                will be set to ``-1 -1'' if -indices has been specified
  38.                or to an empty string otherwise.
  39.